<?php
/**
 * Created by JetBrains PhpStorm.
 * User: zhouyang
 * Date: 13-9-7
 * Time: 下午4:31
 * To change this template use File | Settings | File Templates.
 */
class SummarysDB  extends DBReader{

    //根据summary_id 获取summary 信息
    public function get($summary_id){

        $sql = 'select summary_id, source_id, title, summary, url, content, published, update_time, status, user_id from summarys where summary_id = :summary_id';

        return $this->db()->getRow($sql,array('summary_id'=>$summary_id));
    }
    //获取首页推荐的最新6条数据
    public function getRecommendIndexList(){

        $sql = 'select summary_id, source_id, title, summary, url, content, published, update_time, status, user_id from summarys where status = 5 order by published desc';

        return $this->db()->selectLimit($sql,6);
    }
}